/*
 * RenderSubSystem.h
 *
 *  Created on: Nov 7, 2010
 *      Author: ezbe
 */

#ifndef RENDERSUBSYSTEM_H_
#define RENDERSUBSYSTEM_H_

//includes
#include <GL/glew.h>
#include <GL/glfw.h>

// windef.h defines these and they are just on the way.. (plus we get an BIG WTF?!?)
#undef near
#undef far
#include <SubSystemBase/ISubSystem.h>

class RenderSubSystem: public ISubSystem
{
	public:

		static const char * SUBSYSTEMNAME;

		RenderSubSystem();
		virtual ~RenderSubSystem();

		/**
		 * Initializes the subsystem. If either an exception is thrown or the method returns false,
		 * the SubSystemManager will stop further initialization of subsystems, shutdown the
		 * already initialized subsystems and then the whole execution environment with error message.
		 * @throws Exception, possibly
		 * @return true, if the subsystem was successfully initialized, otherwise false
		 */
		virtual bool initialize();

		/**
		 * Releases subsystem-specific resources and shuts down the subsystem.
		 * Called by SubSystemManager when the execution environment is being shut down.
		 */
		virtual void shutdown();

		/**
		 * Returns is the subsystem initialized or not
		 * @return true, if the subsystem is initialized, otherwise false
		 */
		virtual	bool isInitialized() { return m_initialized; }

		/**
		 * Changes the subsystem configuration to match given configuration.
		 * @throws InvalidConfigurationException, if the configuration isn't valid for this subsystem.
		 */
		//virtual void configure(IConfiguration& config) = 0;

		/**
		 * Returns the name of this subsystem as c-string (null-terminated char-array)
		 * @return Name of the subsystem
		 */
		virtual const char * getName() { return SUBSYSTEMNAME; }

		/**
		 * Sets the logger this subsystem should use
		 * @param logger	Logger to use
		 */
		//virtual void setLogger(ILogger& logger);

	private:
		bool m_initialized;
};

#endif /* RENDERSUBSYSTEM_H_ */
